package com.project.mapper;

import com.project.bean.LinkBean;
import org.apache.ibatis.annotations.*;

import java.util.List;

public interface ILinkMapper {

    @Insert("INSERT INTO t_link(l_name,l_phone)VALUES(#{name},#{phone})")
    @ResultMap("linkMap")
    public void add(LinkBean linkBean);



    @Delete("delete from t_link where pk_linkId=#{id}")
    public void del(int id);



    @Update("update t_link set l_phone=#{phone} where pk_linkId=#{id}")
    public void update(@Param("id") int id, @Param("phone") String phone);



    @Select("select * from t_link where pk_linkId=#{id}")
    @ResultMap("linkMap")
    public LinkBean findById(int id);



    @Select("select * from t_link")
    @ResultMap("linkMap")
    public List<LinkBean> findAll();


}
